package com.zhang.servicedriveruser.controller;


import com.zhang.internalcommon.dto.ResponseResult;
import com.zhang.internalcommon.dto.Car;
import com.zhang.servicedriveruser.service.ICarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张开琦
 * @since 2025-04-12
 */
@RestController
public class CarController {
	@Autowired
	private ICarService carService;

	@PostMapping("/car")
	public ResponseResult addCar(@RequestBody Car car){
		return carService.addCar(car);
	}

	@GetMapping("/car")
	public ResponseResult<Car> getCarById(@RequestParam Long carId){
		ResponseResult<Car> res = carService.getCarById(carId);
		return res;
	}
}
